package top.itmeans.yes.service;

import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import org.springframework.transaction.annotation.Transactional;
import top.itmeans.yes.entity.HomeNewProduct;
import com.baomidou.mybatisplus.extension.service.IService;

import java.util.List;

/**
 * <p>
 * 新品推荐表 服务类
 * </p>
 *
 * @author Yiming.Cao
 * @since 2022-04-28
 */
public interface HomeNewProductService extends IService<HomeNewProduct> {
    /**
     * 添加首页推荐
     */
    @Transactional
    int create(List<HomeNewProduct> homeNewProductList);

    /**
     * 修改推荐排序
     */
    int updateSort(Long id, Integer sort);

    /**
     * 批量删除推荐
     */
    int delete(List<Long> ids);

    /**
     * 批量更新推荐状态
     */
    int updateRecommendStatus(List<Long> ids, Integer recommendStatus);

    /**
     * 分页查询推荐
     */
    Page<HomeNewProduct> list(String productName, Integer recommendStatus, Integer pageSize, Integer pageNum);
}
